require('../models/task.js');
var mongoose  = require('mongoose');
var Task = mongoose.model('Task');
var logger              = require('log4js').getLogger();

exports.create_task = function(task_info,callback){
    var task = new Task(task_info);
    task.save(callback);
};

exports.update_task_state = function(task,state,callback){
    logger.info('change state of ' + task._id + ' to ' + state);
    task.state = state;
    task.save(callback);
};
